package com.Core;


import java.util.HashMap;
import java.util.Map;
import android.content.Context;
import android.view.Display;

import com.DataWrapper.EventTracker;
import com.DataWrapper.MapData;
import com.DataWrapper.MapModel;
import com.DataWrapper.Profile;
import com.Database.GameDatabase;
import com.GameComponent.MainGame;
import com.Object.SeaObject;
import com.Renderer.ObjectTextureLoader;
import com.Triocean.R;

public class GameEngine {
	public static Context globalContext;
	public static Display display;
	//Map prior of Ship
	public static int stepScore = 0;
	public static Map<SeaObject, Integer> shipPrior = new HashMap<SeaObject, Integer>();
	public static Map<SeaObject, Integer> ghostShipMap = new HashMap<SeaObject, Integer>();
	public static int shipCount = 0;
	public static MainGame mainGameAct;
	// Game Component Time
	public static final int LOGO_SCREEN_TIME = 200;
	public static final int SPLASH_SCREEN_TIME = 300;
	public static final int GAME_FPS_SLEEP = 1000 / 60;

	// MUSIC OPTIONS
	// Custom Options
	public static Thread musicThread;
	public static int L_VOLUME = 100;
	public static int R_VOLUME = 100;
	// Fixed Options
	public static final boolean MUSIC_LOOP = true;
	public static final int TITLE_SONG = R.raw.titlesong;
	public static final String songID = "songID";

	// DATABASE OPTIONS
	// Global Options
	public static Thread loaderThread;
	public static GameDatabase gameDb;
	public static final String DATABASE_NAME = "TrioceanDB";
	public static final int DATABASE_VER = 1;
	// Table Names
	public static final String PROFILES_TB = "Profiles";
	public static final String MAPS_TB = "Maps";
	// Map Status Options
	public static final int MAP_UNAVAILABLE = 0;
	public static final int MAP_AVAILABLE = 1;
	public static final int MAP_CLEARED = 2;

	// Map Options
	public static final int MAP_SIZE = 7;

	// Profile Init Options
	public static final int INIT_SCORE = 0;
	public static final int INIT_STEPS = 500;
	public static final int INIT_COINS = 1000;
	public static final int INIT_MAP_TYPE = 1;
	public static final int INIT_MAP_LV = 1;

	// PLAYER PROFILE
	public static Profile profile;

	// DATA LOADER MARK
	public static boolean dataAllLoaded = false;

	// OPENGL OPTIONS
	// Game Field Options
	public static final float LOW_BOUND = -0.5f;
	public static final float UP_BOUND = MAP_SIZE + 0.5f;
	public static final float FIELD_LENGTH = MAP_SIZE + 1.0f;
	public static final float CELL_LENGTH = 1.0f;
	// Game Projection Matrix
	public static final float pjNear = -1f;
	public static final float pjFar = 1f;
	public static final float pjLeft = -0.5f;
	public static final float pjBottom = -0.5f;
	public static float pjTop;
	public static float pjRight;
	// Background Options
	public static final int GAME_FIELD_BG = R.drawable.gamefield_bg;
	public static final int GAME_FIELD_PLAY = R.drawable.gamefield_play;
	// Object Texture Options
	public static final int TEXTURES_PER_ROW = 5;
	public static final float TEXTURE_UNIT = 1.0f / TEXTURES_PER_ROW;
	public static final int GAME_OBJ_TEXTURE = R.drawable.game_objects;
	// MapModel & Texture Loader
	public static MapModel mapModel;
	public static MapData curMap;
	public static ObjectTextureLoader texLoader;

	// GAME LOGIC OPTIONS
	// Event Tracker
	public static EventTracker tracker;
	public static SeaObject curObj;
	public static SeaObject mergedObj;
	public static boolean disableInput = false;
	// Game Logic
	public static GameLogic logic;

	// GAME OBJECT IDs
	public static final int NULL = 0;
	public static final int ROCK = 1;
	public static final int TORNADO = 2;
	public static final int GHOST_SHIP = 3;
	public static final int PEARL = 4;
	public static final int SHELL = 5;
	public static final int CORAIL = 11;
	public static final int SMALL_FISH = 12;
	public static final int MEDIUM_FISH = 13;
	public static final int BIG_FISH = 14;
	public static final int GIANT_FISH = 15;
	public static final int MERMAID = 16;
	public static final int SHIP = 21;
	public static final int SHIP_WRECK = 22;
	public static final int TREASURE_MAP = 23;
	public static final int TREASURE = 24;
	public static final int POSEIDON = 25;

	// GAME OBJECT score

	public static final int GHOST_SHIP_SCORE = 0;
	public static final int CORAIL_SCORE = 5;
	public static final int SMALL_FISH_SCORE = 20;
	public static final int MEDIUM_FISH_SCORE = 100;
	public static final int BIG_FISH_SCORE = 500;
	public static final int GIANT_FISH_SCORE = 1500;
	public static final int MERMAID_SCORE = 5000;
	public static final int SHIP_SCORE = 0;
	public static final int SHIP_WRECK_SCORE = 0;
	public static final int TREASURE_MAP_SCORE = 1000;
	public static final int TREASURE_SCORE = 5000;
	public static final int POSEIDON_SCORE = 10000;
}
